package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.dto.BookLabelDto;
import com.dingreading.cloud.admin.dto.BooksDto;
import com.dingreading.cloud.admin.dto.vo.BookLabelVO;
import com.dingreading.cloud.admin.entity.Books;
import com.dingreading.cloud.common.util.PageUtil;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;

import java.util.Date;
import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface BooksService extends IService<Books> {


    Books getMaxBookNum();

    List<Books> getByJournalIdOrderByAddTimeAsc(Long journalId);

    List<Books> searchByKeyword(String keyword);

    List<Books> getByStatus(Integer status);

    // 根据isbn集合去重查询有封面图的总部书籍
    List<Books> getByIsbnAndImgNotNull(List<String> isbns);

    List<Books> getByIsbnAndLabelNotNull(List<String> isbns);

    Page<Books> getNotImg(PageUtil pageUtil);

    int updateImg(List<Long> ids, String img, Date time);

    Page<Books> pageList(PageUtil pageUtil, String keyword, Integer status);

    List<BooksDto> getByIsbns(List<String> isbns);

    int dropBean(Long id);

    int updateStatus(Long id, Integer status);

    void saveBatch(List<Books> list);

    List<BookLabelDto> labelListByIsbnIn(List<String> isbnList);

    void dbUpdateLabelInfoByIsbn(List<BookLabelVO> voList);

}
